package com.asset.dispoal.company.service;

import com.asset.dispoal.company.api.CompanyService;
import com.asset.dispoal.company.dto.CompanyCourtAreaInsert;
import com.asset.dispoal.company.dto.CompanyLawFirmCourtInsert;
import com.asset.dispoal.company.dto.CompanyRequest;
import com.asset.dispoal.company.service.commom.DeleteCommand;
import com.asset.dispoal.company.service.commom.InertCourtAreaCommand;
import com.asset.dispoal.company.service.commom.InertLawFirmCourtCommand;
import com.asset.dispoal.company.service.commom.InsertCommand;
import com.asset.dispoal.company.service.commom.UpdateCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/1/25$
 */
@Service
public class SysCompanyImp implements CompanyService {


    @Autowired
    InsertCommand insertCommand;

    @Autowired
    UpdateCommand updateCommand;

    @Autowired
    DeleteCommand deleteCommand;

    @Autowired
    InertLawFirmCourtCommand inertLawFirmCourtCommand;

    @Autowired
    InertCourtAreaCommand inertCourtAreaCommand;

    @Override
    public void insert(CompanyRequest request) {
        insertCommand.execute(request);
    }

    @Override
    public void update(CompanyRequest request) {
        updateCommand.execute(request);
    }

    @Override
    public void delete(String id) {
        deleteCommand.execute(id);
    }

    @Override
    public Result insertLawFirmCourt(CompanyLawFirmCourtInsert companyLawFirmCourtInsert) {
        return inertLawFirmCourtCommand.execute(companyLawFirmCourtInsert);
    }

    @Override
    public Result insertCourtArea(CompanyCourtAreaInsert companyCourtAreaInsert) {
        return inertCourtAreaCommand.execute(companyCourtAreaInsert);
    }


}
